package org.cllib.tool;


public class PathElement{
	public final int x , y;
	int g , h;
	
	PathElement parent;
	
	public PathElement(int x, int y , PathElement parent , int g , int h){
		this.x = x;
		this.y = y;
		this.parent = parent;
		this.g = g;
		this.h = h;
	}
	
	public PathElement getParent() {
		return parent;
	}

	public void setParent(PathElement parent) {
		this.parent = parent;
	}

	public int getF(){
		return g + h;
	}

	public int getG() {
		return g;
	}

	public void setG(int g) {
		this.g = g;
	}

	public int getH() {
		return h;
	}

	public void setH(int h) {
		this.h = h;
	}

	public boolean equals(Object obj) {
		// TODO Auto-generated method stub
		if(obj instanceof PathElement){
			PathElement pe = (PathElement)obj;
			if(pe.x == this.x && pe.y == this.y){
				return true;
			}
		}
		return false;
	}
}
